From 22c07c8f80658a1873425e1893445f41a98e468f Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Thu, 22 Feb 2007 22:27:40 +0000 Subject: [PATCH] x86/64: Fix a user of alloc_boot_pages() who should use alloc_boot_low_pages() instead. Signed-off-by: Keir Fraser --- xen/arch/x86/setup.c | 9 +++++++-- xen/arch/x86/x86_64/mm.c | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 79adbd5f7f..61271bbee3 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -476,7 +476,7 @@ void __init __start_xen(multiboot_info_t *mbi) s = initial_images_end; init_boot_pages(s, e); -#if defined (CONFIG_X86_64) +#if defined(CONFIG_X86_64) /* * x86/64 maps all registered RAM. Points to note: * 1. The initial pagetable already maps low 1GB, so skip that. @@ -532,7 +532,12 @@ void __init __start_xen(multiboot_info_t *mbi) k = ((initial_images_end - initial_images_start) & ~PAGE_MASK) ? 1 : 0; k += (initial_images_end - initial_images_start) >> PAGE_SHIFT; - k = alloc_boot_low_pages(k, 1); +#if defined(CONFIG_X86_32) + /* Must allocate within bootstrap 1:1 limits. */ + k = alloc_boot_low_pages(k, 1); /* 0x0 - HYPERVISOR_VIRT_START */ +#else + k = alloc_boot_pages(k, 1); +#endif if ( k == 0 ) panic("Unable to allocate initial images memory\n"); diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index a482c10a06..b098b21f5e 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -44,7 +44,8 @@ struct page_info *alloc_xen_pagetable(void) if ( !early_boot ) return alloc_domheap_page(NULL); - pfn = alloc_boot_pages(1, 1); + /* Early pagetables must come from low 1GB of memory. */ + pfn = alloc_boot_low_pages(1, 1); /* 0x0 - 0x40000000 */ return ((pfn == 0) ? NULL : mfn_to_page(pfn)); } -- 2.30.2